package cyf.Login.service;

import cyf.Login.bean.AdminVO;
import cyf.Login.dao.LoginDaoImpl;
import cyf.Tools.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 登录-服务层
 */
@Service
public class LoginService {
    @Autowired
    public LoginDaoImpl loginDaoImpl;

    /**
     * 验证用户名和密码
     * @param username
     * @param password
     * @return
     */
    public ServerResponse<AdminVO> Login(String username, String password){
        AdminVO vo = loginDaoImpl.login(username,password);
        ServerResponse<AdminVO> serverResponse = ServerResponse.createServerRespsonse(0,"一个存在的用户",vo);
        return serverResponse;
    }
}
